/**
 * 工程名称:OMSJobExecutor
 * 文件名称:ISysRefundService.java
 * 所属包:cn.rkylin.oms.sysrefund.servcie
 * 创建时间:2017年9月21日下午2:55:13
 * 创建人:zhanghao
 */

package cn.rkylin.oms.aftersale.sysrefund.servcie;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;

import cn.rkylin.oms.aftersale.sysrefund.domain.SysRefund;
import cn.rkylin.oms.aftersale.sysrefund.vo.SysRefundVO;

/**
 * 类名:ISysRefundService <br/>
 * 作用: 平台退款单服务层. <br/>
 * 创建原因: 定义平台退款单服务层接口. <br/>
 * 创建时间: 2017年9月21日 下午2:55:13 <br/>
 *
 * @author zhanghao
 * @version v1.0
 * @see
 * @since JDK 1.6
 */
public interface ISysRefundService {
    /**
     * downloadEcRefundAuto:平台退款单自动下载. <br/>
     *
     * @param shopId
     *            店铺ID
     * @return
     * @throws Exception
     * @author zhanghao
     */
    public Object downloadEcRefundAuto(String shopId) throws Exception;

    /**
     * updateEcRefundAuto:平台退款单自动更新. <br/>
     *
     * @param shopId
     *            店铺ID
     * @return
     * @throws Exception
     * @author zhanghao
     */
    public Object updateEcRefundAuto(String shopId) throws Exception;

    /**
     * getSysRefundListByCondition:按条件获取系统退款单列表.
     *
     * @throws Exception
     */
    public List<SysRefundVO> getSysRefundListByCondition(SysRefundVO sysRefundVO) throws Exception;

    /*
     * getSysRefundListById:根据退款单ID获取退款单.
     *
     * @throws Exception
     */
    public SysRefund getSysRefundListById(String sysRefundId) throws Exception;

    /**
     * downloadEcRefundByEcRefundCode:根据店铺ID和平台退款单号执行退款单下载. <br/>
     *
     * @author zhanghao
     * @param shopId
     *            店铺ID
     * @param ecRefundCode
     *            平台退款单编码
     * @return
     * @throws Exception
     */
    public JSONObject downloadEcRefundByEcRefundCode(String shopId, String ecRefundCode) throws Exception;

    /**
     * downloadEcRefundByCustomerId:根据店铺ID和客户ID执行退款单下载. <br/>
     *
     * @author zhanghao
     * @param shopId
     *            店铺ID
     * @param customerId
     *            客户ID
     * @throws Exception
     */
    public JSONObject downloadEcRefundByCustomerId(String shopId, String customerId) throws Exception;

    /**
     * getSysRefundListByCondition:根据查询条件分页查询系统退款单数据. <br/>
     *
     * @author zhanghao
     * @param page
     *            页数
     * @param length
     *            每页长度
     * @param queryParamVO
     *            查询数据VO
     * @return
     * @throws Exception
     */
    public PageInfo<SysRefundVO> getSysRefundListByCondition(int page, int length, SysRefundVO queryParamVO) throws Exception;

    /**
     * findStateCount:获取系统退款单各个状态的查询结果数字. <br/>
     *
     * @author zhanghao
     * @param queryParamVO
     * @return
     * @throws Exception
     */
    public List<HashMap> findStateCount(SysRefundVO queryParamVO) throws Exception;

    /**
     * cancelRefunds:根据退款单ID废弃退款单. <br/>
     *
     * @author zhanghao
     * @param refundIdArray
     *            退款单ID数组
     * @return
     * @throws Exception
     */
    public int cancelSysRefunds(String[] refundIdArray) throws Exception;

    /**
     * saveSysRefunds:保存退款单及其明细. <br/>
     *
     * @author zhanghao
     * @param STATEMENT_UPDATE
     * @return
     * @throws Exception
     */
    public int saveSysRefunds(SysRefundVO sysRefundVO) throws Exception;

    public List<SysRefund> findSysRefundList(Map<String, String> map) throws Exception;

    /**
     * getSysRefundDetailById:根据系统退款单ID获取系统退款单详细信息. <br/>
     *
     * @author zhanghao
     * @param sysRefundId
     * @return
     * @throws Exception
     */
    public SysRefundVO getSysRefundDetailById(String sysRefundId) throws Exception;

    /**
     * sysRefundAppr:根据退款单ID执行退款单审核. <br/>
     *
     * @author zhanghao
     * @param sysRefundId
     * @return
     * @throws Exception
     */
    public JSONObject doAppr(String sysRefundId) throws Exception;

    /**
     * sysRefundForceAppr:根据退款单ID执行退款单强制审核. <br/>
     *
     * @author zhanghao
     * @param sysRefundId
     * @return
     * @throws Exception
     */
    String doForceAppr(String sysRefundId) throws Exception;

    /**
     * sysRefundForceAppr:取消审核. <br/>
     *
     * @author zhanghao
     * @param refundIdArray
     * @return
     * @throws Exception
     */
    int doCancelAppr(String[] refundIdArray) throws Exception;

    /**
     * doRefund:执行退款. <br/>
     *
     * @author zhanghao
     * @param refundIdArray
     * @return
     * @throws Exception
     */
    public int doRefund(String[] refundIdArray) throws Exception;

    /**
     * doRefund:退款校验. <br/>
     *
     * @author zhanghao
     * @param refundId
     * @return
     * @throws Exception
     */
    public String doRefundValid(String refundId) throws Exception;

    /**
     * doForceApprValid:强制审核校验. <br/>
     *
     * @author zhanghao
     * @param sysRefundId
     * @return
     * @throws Exception
     */
    JSONObject doForceApprValid(String sysRefundId) throws Exception;

    /**
     * 通过订单ID获取退款单基本信息
     * 
     * @param orderId
     * @return
     * @throws Exception
     */
    public List<SysRefund> findSysRefundListByOrderId(String orderId) throws Exception;
    
    /**
     * 根据条件取得数量
     * @param params
     * @return
     * @throws Exception
     */
    public int selectCount(Map<String,Object> params) throws Exception;

    /**
     * 根据订单号下载退款单
     * @param params
     * @return
     * @throws Exception
     */
    JSONObject downloadEcRefundByOrderCode(String shopId, String orderCode) throws Exception;

    /**
     * getUnGoingCount:获取进行中的单据数量 <br/>
     *
     * @author zhanghao
     * @param paramMap
     * @return
     */
    public int getUnGoingCount(Map<String, String> paramMap) throws Exception;
}